package com.chixing.day07_adstract;

/*
* 1.Account 作为父类 SavingAccount 和 CreditAccount 有共有的属性和方法
* 将公共部分抽离出来
* 放到另一个类中  减少代码 的冗余性
* Account acc=new Account(); error
* Account acc=new SavingAccount();
 * */
public abstract class Account {
    //存款
    public abstract void depoist();

    //取款
    public abstract void withdraw();

}
class SavingAccount extends Account{

    @Override
    public void depoist() {

    }

    @Override
    public void withdraw() {

    }
}

class CreditAccount extends Account{

    @Override
    public void depoist() {

    }

    @Override
    public void withdraw() {

    }
}

class LoanAccount extends Account{

    @Override
    public void depoist() {

    }

    @Override
    public void withdraw() {

    }
}
